<template>
	<view class="home">
		<view class="tabs_monitor">
			<view class="tabs_i" v-for="(i,index) in monitorArr" :key="index" @click="monitorFn(i.text)">
				<image class="img" :src="i.img" mode=""></image>
				<view class="text">
					<view class="">
						{{i.text}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				monitorArr: [{
					img: require('@/static/home/cesyia.png'),
					text: '配置流速仪'
				}, {
					img: require('@/static/home/cesyib.png'),
					text: '配置渠道断面'
				}, {
					img: require('@/static/home/tuoga.png'),
					text: '配置毕托管'
				}, {
					img: require('@/static/home/yuliangz.png'),
					text: '配置雨量站'
				}, {
					img: require('@/static/home/liusua.png'),
					text: '自动伸缩杆'
				}],
			}
		},
		onLoad(option) {

		},
		methods: {
			monitorFn(i) {
				if (i == '配置流速仪') {
					if (this.vuex_devicename == '') {
						uni.showToast({
							title: '蓝牙未连接',
							duration: 2000
						});
						return
					}
					uni.navigateTo({
						url: '/pagesA/aproductA/cesuyi'
					});
				}
				if (i == '配置渠道断面') {
					if (this.vuex_devicename == '') {
						uni.showToast({
							title: '蓝牙未连接',
							duration: 2000
						});
						return
					}
					uni.navigateTo({
						url: '/pagesA/aproductA/courseA'
					});
				}
				if (i == '配置毕托管') {
					if (this.vuex_devicename == '') {
						uni.showToast({
							title: '蓝牙未连接',
							duration: 2000
						});
						return
					}
					uni.navigateTo({
						url: '/pages/home/measuringflow/bituoguan'
					});
				}
				if (i == '配置雨量站') {
					if (this.vuex_devicename == '') {
						uni.showToast({
							title: '蓝牙未连接',
							duration: 2000
						});
						return
					}
					uni.navigateTo({
						url: '/pages/home/measureFun/yuLiangJi/setUp'
					});
				}
				if (i == '自动伸缩杆') {
					if (this.vuex_devicename == '') {
						uni.showToast({
							title: '蓝牙未连接',
							duration: 2000
						});
						return
					}
					uni.navigateTo({
						url: '/pages/home/shensuogan'
					});
				}
			}
		}
	}
</script>
<style scoped lang="scss">
	// 水情
	.tabs_monitor {
		padding: 30rpx;

		.tabs_i {
			margin-bottom: 20rpx;
			padding: 30rpx;
			border-radius: 20rpx;
			text-align: center;
			background-color: #ffffff;
			display: flex;
			align-items: center;
			justify-content: space-around;

			.img {
				width: 120rpx;
				height: 120rpx;
			}

			.text {
				width: 450rpx;
				color: #000000;
				font-size: 60rpx;
			}
		}
	}
</style>
<style>
	page {
		background-color: #d5e8f1;
	}
</style>